package au.org.htd.youslide.ppt;

import java.util.HashMap;
import java.util.Map;

public class DisplayText extends Text {
	public static final String ENGLISH_DEFAULT_FONT = "Arial";
	public static final String CHINESE_DEFAULT_FONT = "汉鼎简中楷";
	
	private String englishFont = ENGLISH_DEFAULT_FONT;
	private String chineseFont = CHINESE_DEFAULT_FONT;
	private int englishFontSize = 44;
	private int chineseFontSize = 54;
	private static Map<Integer, Integer> ENGLISH_FONT_SIZE;
	private static Map<Integer, Integer> CHINESE_FONT_SIZE;

	
	public DisplayText(String pEnglish, String pChinese) {
		super(pEnglish, pChinese);
	}

	static {
		int[] englishSizes = {44, 44, 44, 44, 44, 36, 31};
		ENGLISH_FONT_SIZE = new HashMap<Integer, Integer>();
		for(int i=0; i<englishSizes.length; i++) {
			ENGLISH_FONT_SIZE.put(i+1, englishSizes[i]);
		}
		
		int[] chineseSizes = {54, 54, 54, 54, 43, 36, 31};
		CHINESE_FONT_SIZE = new HashMap<Integer, Integer>();		
		for(int i=0; i<chineseSizes.length; i++) {
			CHINESE_FONT_SIZE.put(i+1, chineseSizes[i]);
		}
	}

	public String getEnglishFont() {
		return englishFont;
	}

	public void setEnglishFont(String englishFont) {
		this.englishFont = englishFont;
	}

	public String getChineseFont() {
		return chineseFont;
	}

	public void setChineseFont(String chineseFont) {
		this.chineseFont = chineseFont;
	}

	public int getEnglishFontSize() {
		return englishFontSize;
	}

	public void setEnglishFontSize(int englishFontSize) {
		this.englishFontSize = englishFontSize;
	}

	public int getChineseFontSize() {
		return chineseFontSize;
	}

	public void setChineseFontSize(int chineseFontSize) {
		this.chineseFontSize = chineseFontSize;
	}
	
	public static int getEnglishFontSize(int pLines) {
		Integer size = ENGLISH_FONT_SIZE.get(pLines);
		return null==size?44:size;
	}

	public static int getChineseFontSize(int pLines) {
		Integer size = CHINESE_FONT_SIZE.get(pLines);
		return null==size?44:size;
	}
}
